/* 
 * File:   CheckerTexture.h
 * Author: neuma173
 *
 * Created on October 3, 2011, 11:59 AM
 */

#ifndef _CHECKERTEXTURE_H
#define	_CHECKERTEXTURE_H

#include <textures/Texture.h>


class CheckerTexture :public Texture {
public:
    CheckerTexture(const Vector3D& color1, const Vector3D& color2, double checksize);
    CheckerTexture(const CheckerTexture& orig);
    void setBevel(double bevel){this->bevel = bevel;}
    Vector3D getColor(const IntersectionResult& ir);
    Vector3D getNormal(const IntersectionResult& ir);
    virtual ~CheckerTexture();
private:
    double bevel;
    Vector3D color1;
    Vector3D color2;
    double checkSize;
    int clamp(double n){return (n>0)? (int)(n) : (int)(n-1);}

};

#endif	/* _CHECKERTEXTURE_H */

